import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-09-05
 * Time: 8:44
 * To BE A Better Person-2020-3-2
 */
public class TestDemo8 {
    public static void main(String[] args) {
        //写文件
        try(OutputStream outputStream=new FileOutputStream("test2.txt")){

            //1.
//            outputStream.write('h');
//            outputStream.write('i');
            //2.
            String s="hello";
            outputStream.write(s.getBytes());

        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
